
import request from '@/utils/request'
// 获取员工基本信息
export const getEmployeeListApi = (params) =>
  request({
    url: `/sys/user`,
    params
  })

// 导出员工信息
export const exportEmployeeApi = () =>
  request({
    url: `/sys/user/export`,
    method: 'get',
    // 设置响应类型为blob
    responseType: 'blob'
  })
// 下载模版
export const downloadEmployeeApi = () =>
  request({
    url: `/sys/user/import/template`,
    method: 'get',
    // 设置响应类型为blob
    responseType: 'blob'
  })
// 上传员工信息
export const uploadEmployeeApi = file => {
  const formData = new FormData()
  formData.append('file', file)
  return request({
    url: `/sys/user/import`,
    method: 'post',
    data: formData
  })
}
// 添加员工1
export const addEmployeeApi = data =>
  request({
    url: `/sys/user`,
    method: 'post',
    data
  })
// 获取员工基本信息
export const getEmployeeDetailApi = id =>
  request({
    url: `/sys/user/${id}`
  })
// 修改员工基本信息
export const updateEmployeeApi = data =>
  request({
    url: `/sys/user/${data.id}`,
    method: 'put',
    data
  })
